package com.example.demo.repository;

import com.example.demo.pojo.Stats;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

public interface StatsRepository extends JpaRepository<Stats, Integer> {

    @Query(value = "select count(*) from stats", nativeQuery = true)
    Integer countAll();

    @Query(value = "select count(*) from stats where s_time between ?1 and ?2", nativeQuery = true)
    Integer countAllByTime(Date date1, Date date2);
}
